package square.data;

import java.util.ArrayList;

import pedrosm.data.ScriptData;


import square.script.CreatureScript;

/**
 * 
 * @author Pedro Silva Moreira
 */
public class CreatureData extends MapObjectData {

	// Level
	private Integer experience = 0;
	private Integer level = 1;

	// Health
	private Integer health = 10;
	private Integer maxHealth = 10;

	// Mana
	private Integer mana = 0;
	private Integer maxMana = 0;

	// Attributes
	private Integer attack = 0;
	private Integer defense = 0;
	private Integer magic = 0;
	private Integer speed = 10;
	private Integer critical = 5;

	private Integer range = 3;
	private String follow = "follow";
	private Boolean walk = true;
	private Boolean aggressive = false;

	// Exhaust
	private Integer exhaust = 0;
	private Integer maxExhaust = 10;
	private Integer exhaustTime = 500; // Reduce 1 exhaust at each |exhaustTime|
										// miliseconds
	private ScriptData<CreatureScript> script;
	private ArrayList<SkillData> skills = new ArrayList<SkillData>();

	// Instance
	@Override
	public CreatureData instance() {
		CreatureData result = (CreatureData) super.instance();
		result.setSkills(new ArrayList<SkillData>());

		for (SkillData skill : getSkills()) {
			result.getSkills().add(skill.instance());
		}

		return result;
	}

	// Get & Set
	public Integer getExperience() {
		return experience;
	}

	public void setExperience(Integer experience) {
		this.experience = experience;
	}

	public Integer getLevel() {
		return level;
	}

	public void setLevel(Integer level) {
		this.level = level;
	}

	public Integer getHealth() {
		return health;
	}

	public void setHealth(Integer health) {
		this.health = health;
	}

	public Integer getMaxHealth() {
		return maxHealth;
	}

	public void setMaxHealth(Integer maxHealth) {
		this.maxHealth = maxHealth;
	}

	public Integer getMana() {
		return mana;
	}

	public void setMana(Integer mana) {
		this.mana = mana;
	}

	public Integer getMaxMana() {
		return maxMana;
	}

	public void setMaxMana(Integer maxMana) {
		this.maxMana = maxMana;
	}

	public Integer getAttack() {
		return attack;
	}

	public void setAttack(Integer attack) {
		this.attack = attack;
	}

	public Integer getDefense() {
		return defense;
	}

	public void setDefense(Integer defense) {
		this.defense = defense;
	}

	public Integer getMagic() {
		return magic;
	}

	public void setMagic(Integer magic) {
		this.magic = magic;
	}

	public Integer getSpeed() {
		return speed;
	}

	public void setSpeed(Integer speed) {
		this.speed = speed;
	}

	public Integer getCritical() {
		return critical;
	}

	public void setCritical(Integer critical) {
		this.critical = critical;
	}

	public Integer getRange() {
		return range;
	}

	public void setRange(Integer range) {
		this.range = range;
	}

	public Boolean getAggressive() {
		return aggressive;
	}

	public void setAggressive(Boolean aggressive) {
		this.aggressive = aggressive;
	}

	public Integer getExhaust() {
		return exhaust;
	}

	public void setExhaust(Integer exhaust) {
		this.exhaust = exhaust;
	}

	public Integer getMaxExhaust() {
		return maxExhaust;
	}

	public void setMaxExhaust(Integer maxExhaust) {
		this.maxExhaust = maxExhaust;
	}

	public Integer getExhaustTime() {
		return exhaustTime;
	}

	public void setExhaustTime(Integer exhaustTime) {
		this.exhaustTime = exhaustTime;
	}

	public ScriptData<CreatureScript> getScript() {
		return script;
	}

	public void setScript(ScriptData<CreatureScript> script) {
		this.script = script;
	}

	public String getFollow() {
		return follow;
	}

	public void setFollow(String follow) {
		this.follow = follow;
	}

	public Boolean getWalk() {
		return walk;
	}

	public void setWalk(Boolean walk) {
		this.walk = walk;
	}

	public ArrayList<SkillData> getSkills() {
		return skills;
	}

	public void setSkills(ArrayList<SkillData> skills) {
		this.skills = skills;
	}
}
